package ${package};

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.List;

import ${rootPkg}.dao.${daoClass};
import ${rootPkg}.entity.${entityClass};

import net.zdsoft.keel.dao.BasicDAO;
import net.zdsoft.keel.dao.MultiRowMapper;
import net.zdsoft.keel.util.Pagination;
import net.zdsoft.keelcnet.util.GUIdGenerator;



@SuppressWarnings("unchecked")
public class ${daoImplClass} extends BasicDAO implements ${daoClass} {

	public List get${entityClass}List(String unitId, Pagination page) throws Exception {
        ${getListMethod}
    }

	public ${entityClass} get${entityClass}(String ${entityVar}Id) throws Exception {
        ${getMethod}
    }

	public boolean delete${entityClass}(String[] ${entityVar}Ids) throws Exception {
        ${deleteMethod}
    }

	public void add${entityClass}(${entityClass} ${entityVar}) throws Exception {
        String id = GUIdGenerator.getUUID().replaceAll("-", "").toUpperCase();
        ${entityVar}.setId(id);
        ${addMethod}
    }

	public boolean update${entityClass}(${entityClass} ${entityVar}) throws Exception {
        ${updateMethod}
    }

    ${mapperClass}

    public String buildInParam(String[] ids) {
        StringBuffer sb=new StringBuffer();
		for (int i=0; i<ids.length; i++) {
			sb.append("'").append(ids[i]).append("',");
		}
		sb.deleteCharAt(sb.length()-1);
        return sb.toString();
    }
    
}

